package com.powernode.boss.models;


import com.powernode.boss.common.enums.SysCode;

public class Result {
    private Integer code;
    private String msg;
    private Object data;


    public static Result ok(){
        Result result = new Result();
        result.setCode(1000);
        result.setMsg("请求成功");
        result.setData("");
        return result;
    }
    public static Result ok(Object data){
        Result result = new Result();
        result.setCode(1000);
        result.setMsg("成功");
        result.setData(data);
        return result;
    }

    public static Result fail(SysCode sysCode){
        Result result = new Result();
        result.setCode(sysCode.getCode());
        result.setMsg(sysCode.getText());
        result.setData("");
        return result;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
